package com.example.shiro.controller;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created by apple on 2020/9/6.
 */
@Component
@RabbitListener(queues = "TestDirectQueue")//监听的队列名称 TestDirectQueue
public class DirectReceiver {

    @RabbitHandler
    public void process(String testMessage) {
        System.out.println(System.currentTimeMillis());
        System.out.println("DirectReceiver消费者收到消息  : " + testMessage.toString());
    }

}
